Merged
Conversation
Entire-Checkpoint: aeffc337f24b
Entire-Checkpoint: cd3732d55e3f
Contributor
There was a problem hiding this comment.
Pull request overview
This PR hardens Factory AI Droid worker hook parsing so Entire continues running when Droid omits tool_use_id and/or emits tool_response as either an object or a string, and adds regression coverage to prevent reintroducing these failures.
Changes:
- Updated Factory PostToolUse parsing to accept
tool_responseas raw JSON (object or string) and extractagentIdrobustly. - Added a deterministic fallback
tool_use_idwhen Droid omits it. - Added unit + Factory-only E2E regression tests to ensure hooks do not surface parsing errors during interactive runs.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
e2e/testutil/assertions.go |
Adds a helper to assert console.log does not include hook/parsing failure strings. |
e2e/tests/factory_hooks_test.go |
Introduces a Factory-only E2E regression test validating worker hook execution doesn’t produce hook errors. |
cmd/entire/cli/agent/factoryaidroid/types.go |
Extends hook payload types and adds deterministic fallback tool use ID hashing. |
cmd/entire/cli/agent/factoryaidroid/lifecycle.go |
Implements fallback tool_use_id wiring and supports tool_response object-or-string parsing. |
cmd/entire/cli/agent/factoryaidroid/lifecycle_test.go |
Adds focused lifecycle tests for missing tool_use_id and string tool_response parsing. |
Entire-Checkpoint: 71e412557efe
Fix gosec/wrapcheck lint errors in loadFallbackToolUseState and replace forbidden cli/testutil import with inline git.PlainInit in lifecycle_test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 80de6f75ba55
Contributor
Author
|
Follow-up: fix lint and architecture test violations
|
Avoids string allocation and handles whitespace-padded JSON correctly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Entire-Checkpoint: 53a994da50ed
Contributor
Author
|
Follow-up: bytes-based null check in
|
Soph
approved these changes
Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix Factory AI Droid fallback
tool_use_idhandling so repeated Worker runs with identical inputs do not collide while pre/post task hooks still correlate correctly.What Changed
tool_use_idgenerated duringPreToolUse.entire/tmpsoPostToolUsecan recover and consume the exact ID for the matching Worker invocation when Factory omitstool_use_idtool_use_idinvocations stay unique, correlate in LIFO order, and clean up temporary stateVerification
go test ./cmd/entire/cli/agent/factoryaidroidmise run test:e2e --agent factoryai-droid TestFactoryTaskHooksDoNotFailfixes: #917, #930, #938